package com.lin.service.impl;

import com.lin.entity.CollectionEntity;
import com.lin.mapper.CollectionMapper;
import com.lin.service.CollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CollectionServiceImpl implements CollectionService {

    @Autowired
    private CollectionMapper collectionMapper;
    /**
     * 获取收藏夹
     * @return
     */
    public CollectionEntity getCollection(Integer userId) {
        return collectionMapper.getCollection(userId);
    }

    /**
     * 新建收藏夹
     * @param collection
     */
    public void saveClt(CollectionEntity collection) {
        collectionMapper.saveClt(collection);
    }

    /**
     * 更新收藏夹
     * @param collection
     */
    public void updateClt(CollectionEntity collection) {
        collectionMapper.updateClt(collection);
    }

    /**
     * 删除收藏夹
     * @param id
     */
    public void deleteClt(Integer id) {
        collectionMapper.deleteClt(id);
    }

}
